package context

import "github.com/gookit/validate"

type SMSPhoneContext struct {
	Telephone string `validate:"required|cnMobile" json:"telephone"` // 手机号码
	CaptchaId string `validate:"required"  json:"captchaId"`
	Vcode     string `validate:"required"  json:"vcode"`
	SystemId  uint64 `json:"systemId"`
}

// Messages 您可以自定义验证器错误消息
func (f SMSPhoneContext) Messages() map[string]string {
	return validate.MS{
		"required":           "{field}不能为空",
		"Telephone.cnMobile": "{field}输入不合法",
	}
}

// Translates 你可以自定义字段翻译
func (f SMSPhoneContext) Translates() map[string]string {
	return validate.MS{
		"Telephone": "用户手机",
		"CaptchaId": "验证码编号",
		"Vcode":     "验证码",
	}
}

type SettingSMSPhoneContext struct {
	Telephone string `validate:"required|cnMobile" json:"telephone"` // 手机号码
	Code      string `validate:"required"  json:"code"`
	SystemId  uint64 `json:"systemId"`
}

// Messages 您可以自定义验证器错误消息
func (f SettingSMSPhoneContext) Messages() map[string]string {
	return validate.MS{
		"required":           "{field}不能为空",
		"Telephone.cnMobile": "{field}输入不合法",
	}
}

// Translates 你可以自定义字段翻译
func (f SettingSMSPhoneContext) Translates() map[string]string {
	return validate.MS{
		"Telephone": "用户手机",
		"Code":      "手机短信码",
	}
}

type ForgetPasswordContext struct {
	Telephone string `validate:"required|cnMobile" json:"telephone"` // 手机号码
	Code      string `validate:"required"  json:"code"`
	Password  string `validate:"required"  json:"password"`
	SystemId  uint64 `json:"systemId"`
}

// Messages 您可以自定义验证器错误消息
func (f ForgetPasswordContext) Messages() map[string]string {
	return validate.MS{
		"required":           "{field}不能为空",
		"Telephone.cnMobile": "{field}输入不合法",
	}
}

// Translates 你可以自定义字段翻译
func (f ForgetPasswordContext) Translates() map[string]string {
	return validate.MS{
		"Telephone": "用户手机",
		"Code":      "手机短信码",
		"Password":  "密码",
	}
}
